package com.wenlin.myproduction.base;

import com.wenlin.myproduction.R;
import com.wenlin.myproduction.util.UI;

/**
 * @author 文琳
 * @time 2018/3/2 17:45
 * @desc 带返回键的二级页面母类
 */
public abstract class BaseSwipeActivity extends AbsActivity {

    /**
     * 设置标题
     * @param resId 标题字符串的资源编号
     */
    public void setTitle(int resId) {
        String title = getResources().getString(resId);
        setTitle(title);
    }

    /**
     * 设置标题
     * @param title 标题文字
     */
    public void setTitle(String title) {
        UI.setText(findViewById(R.id.tv_title), title);
        UI.setOnClickListener(findViewById(R.id.iv_back), v -> finish());
    }
}
